<template>
<div>
  <div class="container">
    <div class="row clearfix">
      <div class="col-md-12 column">
        <div class="jumbotron">
          <h1>
            Hello, world!
          </h1>
          <p>
            This is a template for a simple marketing or informational website. It includes a large callout called the hero unit and three supporting pieces of content. Use it as a starting point to create something more unique.
          </p>
          <p>
            <a class="btn btn-primary btn-large" href="#">Learn more</a>
          </p>
        </div>
        <div class="row clearfix">
          <div class="col-md-4 column">
          </div>
          <div class="col-md-4 column">

              <div class="form-group">
                <label for="exampleInputEmail1">账户</label><input type="text" v-model="username" class="form-control" id="exampleInputEmail1" />
              </div>
              <div class="form-group">
                <label for="exampleInputPassword1">密码</label><input type="password" v-model="password" class="form-control" id="exampleInputPassword1" />
              </div>
              <div class="form-group">
                <label for="exampleInputPassword1">姓名</label><input type="text" v-model="name" class="form-control"  />
              </div>
              <div class="form-group">
                <label for="exampleInputPassword1">电话</label><input type="text" v-model="tel" class="form-control"  />
              </div>
              <div class="form-group">
              </div>
              <div class="checkbox">

              </div> <button class="btn" v-on:click="register">注册</button>

          </div>
          <div class="col-md-4 column">
          </div>
        </div>
      </div>
    </div>
  </div>
</div>
</template>

<script>
export default {
  name: "Register",
  data(){
    return{
      username:"",
      password:"",
      name:"",
      tel:""

    }
  },
  methods:{
    register(){
      let _this=this;
      _this.$ajax.post(baseUrl+"user/register",
          {
            username:_this.username,
            password:_this.password,
            name:_this.name,
            tel:_this.tel
          }).then((response)=>{
            if (response.data=="success"){
              _this.$router.push("/");
            }
      })
    }
  }
}
</script>

<style scoped>

</style>